﻿using Abp.Domain.Repositories;
using RMM.Core.Entity.Users;
using RMM.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RMM.Core.UserService
{
    public class UserService : EntityDomainService<User, long>, IUserService
    {
        private readonly IRepository<User, long> _userRepository;

        public UserService(IRepository<User, long> repository)
            :base(repository)
        {
            _userRepository = repository;
        }


        public Task<IQueryable<User>> GetUserListAsync()
        {
            var result = _userRepository.GetAll();
            return Task.FromResult(result);
        }

            public Task<IQueryable<User>> GetUserListAsync(bool isDel)
        {
            var result = _userRepository.GetAll().Where(p => p.Status == (isDel ? 7 : 0));
            return Task.FromResult(result);
        }
    }
}
